<?php
/**
 * @author Son Nguyen
 * @copyright 2011
 */

class loginModel extends CI_Model
{
	function __construct(){
		parent::__construct('');
	}
	public function checklogin($username,$password){
		$query = $this->model->table('users')
					  ->select('users.*,groups.groupname,groups.types')
					  ->join('groups','groups.id = users.groups','left')
					  ->where('username',$username)
					  ->where('password',$password)
					  ->where('status',1)
					  ->find();
		return $query;
	}
}